def days_in_month(year, month):
    if month in [1, 3, 5, 7, 8, 10, 12]:
        return 31
    if month in [4, 6, 9, 11]:
        return 30
    if year % 4 == 0:
        if year % 100 == 0:
            if year % 400 == 0:
                return 29
            else:
                return 28
        else:
            return 29
    else:
        return 28


if __name__ == '__main__':
    counts = 0
    day = 2  # 0-6，其中0代表周日
    for year in range(1901, 2001):
        for month in range(1, 13):
            day += days_in_month(year, month)
            day %= 7
            if day == 0:
                counts += 1
    print(counts)
